import request from '@/router/axios'

export function fetchList(query) {
  return request({
    url: '/exam/auditEvidence/page',
    method: 'get',
    params: query
  })
}

export function fetchProjectList(query) {
  return request({
    url: '/exam/auditEvidence/projectPage',
    method: 'get',
    params: query
  })
}

export function listEvidencesByProjectId(query) {
  return request({
    url: '/exam/auditEvidence/listEvidencesByProjectId',
    method: 'get',
    params: query
  })
}

export function addObj(obj) {
  return request({
    url: '/exam/auditEvidence',
    method: 'post',
    data: obj
  })
}

export function getObj(id) {
  return request({
    url: '/exam/auditEvidence/' + id,
    method: 'get'
  })
}

export function getEvidence(id) {
  return request({
    url: '/exam/auditEvidence/getEvidence/' + id,
    method: 'get'
  })
}

export function getEvidenceByProjectId(id) {
  return request({
    url: '/exam/auditEvidence/getEvidenceByProjectId/' + id,
    method: 'get'
  })
}

export function delObj(id) {
  return request({
    url: '/exam/auditEvidence/' + id,
    method: 'delete'
  })
}

export function putObj(obj) {
  return request({
    url: '/exam/auditEvidence',
    method: 'put',
    data: obj
  })
}

export function submit(obj) {
  return request({
    url: '/exam/auditEvidence/submit',
    method: 'post',
    data: obj
  })
}

export function sendEvidence(obj) {
  return request({
    url: '/exam/auditEvidence/sendEvidence',
    method: 'post',
    data: obj
  })
}

export function saveSubmit(obj) {
  return request({
    url: '/exam/auditEvidence/saveSubmit',
    method: 'post',
    data: obj
  })
}

export function forward(obj) {
  return request({
    url: '/exam/auditEvidence/forward',
    method: 'post',
    data: obj
  })
}

export function submitAudit(obj) {
  return request({
    url: '/exam/auditEvidence/submitAudit',
    method: 'post',
    data: obj
  })
}

/**
 * 生成文书
 * @param obj
 * @returns {AxiosPromise}
 */
export function genEvidenceWord(obj) {
  return request({
    url: '/exam/auditEvidence/genEvidenceWord',
    method: 'post',
    data: obj
  })
}

export function genEngineeringWord(obj) {
  return request({
    url: '/exam/auditEvidence/genEngineeringWord',
    method: 'post',
    data: obj
  })
}

export function closeEvidence(obj) {
  return request({
    url: '/exam/auditEvidence/closeEvidence',
    method: 'post',
    data: obj
  })
}
export function submitApproval(obj) {
  return request({
    url: '/exam/auditEvidence/submitApproval',
    method: 'post',
    data: obj
  })
}
export function approvalThrough(obj) {
  return request({
    url: '/exam/auditEvidence/approvalThrough',
    method: 'post',
    data: obj
  })
}
